//
//  MqFindBikeCommentTableViewCell.m
//  Meiqi
//
//  Created by lanou on 16/1/21.
//  Copyright © 2016年 KFC. All rights reserved.
//

#import "MqFindBikeCommentTableViewCell.h"
#import <UIImageView+WebCache.h>
@implementation MqFindBikeCommentTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        
        _imageV = [[UIImageView alloc] initWithFrame:CGRectMake(10, 10, 50, 50)];
        //_imageV.backgroundColor = [UIColor redColor];
        _imageV.layer.cornerRadius = 25;
        [self.contentView addSubview:_imageV];
        
        _titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(_imageV.right + 10, 10, kScreenWidth - _imageV.right  - 60, 30)];
        //_titleLabel.backgroundColor = [UIColor cyanColor];
        [self.contentView addSubview:_titleLabel];
        
        _timeLabel = [[UILabel alloc] initWithFrame:CGRectMake(_titleLabel.left, _titleLabel.bottom , _titleLabel.width, 20)];
        //_timeLabel.backgroundColor = [UIColor greenColor];
        [self.contentView addSubview:_timeLabel];
        
        _supportButton = [UIButton buttonWithType:(UIButtonTypeCustom)];
        _supportButton.frame = CGRectMake(kScreenWidth - _imageV.right - 50, _imageV.top, 50, 30);
        [self.contentView addSubview:_supportButton];
        
        _contentLabel = [[UILabel alloc] initWithFrame:CGRectMake(_timeLabel.left, _timeLabel.bottom + 10, kScreenWidth - 70, 30)];
        _contentLabel.numberOfLines = 0;
        [self.contentView addSubview:_contentLabel];
        
    }
    return self;
}

- (void)setModel:(MqFindBikeBikeDetailCommentModel *)model
{
    _model = model;
    _imageV.image = [UIImage imageNamed:@"icon_avatar@2x"];
    _contentLabel.text = model.content;
    _titleLabel.text = model.username;
    _timeLabel.text = model.create_at;
}





- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
